package sjtu.rfid.rri.services.tds;

import java.util.Map;

/**
 * 
 * @author jinghao
 * 
 */
public interface EPC {

	/**
	 * URI form a specific tag encoding of an EPC. URIs are encoded with the
	 * entire URI having this form: urn:epc:tag:EncName:EncodingSpecificFields
	 * 
	 * @return A URI String
	 */
	public String getEPCTagURI();

	/**
	 * URI forms are provided for pure identities, which contain just the EPC
	 * fields that serve to distinguish one object from another. These URIs take
	 * the form of Uniform Resource Names (URNs), with a different URN namespace
	 * allocated for each pure identity type. For the EPC General Identifier,
	 * the pure identity URI representation is as follows:
	 * urn:epc:id:gid:GeneralManagerNumber.ObjectClass.SerialNumber.
	 * 
	 * @return A Pure Identity URI String
	 */
	public String getPureIDURI();

	/**
	 * Get a URI String that represents this tags in hex format.
	 * <p>
	 * In this form: urn:epc:raw:BitLength.Value <br>
	 * Where BitLength is the number of bits in the representation, and Value is
	 * the entire bit-level representation converted to a single hexadecimal
	 * number and preceded by the letter "x".<br>
	 * For example, this bit string:
	 * 0000000000000000000100100011010011011110101011011011111011101111
	 * corresponds to this raw URI: urn:epc:raw:64.x00001234DEADBEEF
	 * </p>
	 * <p>
	 * In order to ensure that a given bit string has only one possible raw URI
	 * representation, the number of digits in the hexadecimal value is required
	 * to be equal to the BitLength divided by four and rounded up to the
	 * nearest whole number. Moreover, only uppercase letters are permitted for
	 * the hexadecimal digits A, B, C, D, E, and F.
	 * </p>
	 * <p>
	 * It is intended that this URI form be used only when reporting errors
	 * associated with reading invalid tags and when representing partially
	 * written tag. It is not intended to be a general mechanism for
	 * communicating arbitrary bit strings for other purposes.
	 * </p>
	 * 
	 * @return A string in URI format of this tags data in raw hex format.
	 */
	public String getRawHex();

	/**
	 * Get a URI String that represents this tags in decimal format.
	 * 
	 * In this form: urn:epc:raw:BitLength.Value <br>
	 * <p>
	 * Where BitLength is the number of bits in the representation, and Value is
	 * the entire bit-level representation converted to a single decimal number.
	 * </p>
	 * 
	 * @return A string in URI format of this tags data in raw decimal format.
	 * @deprecated According to EPCglobal TDS v1.3.1, page.61, line 1752.
	 */
	@Deprecated
	public String getRawDecimal();

	/**
	 * Get a byte array that represents this tag.
	 * 
	 * @return byte[]
	 */
	public byte[] getRawBytes();

	/**
	 * Get a String representation of the bits that make up this tag.
	 * 
	 * @return A binary String.
	 */
	public String getBinaryString();

	/**
	 * Get the tag encoding scheme; name-bitlength. e.g. gid-96, sgtin-198, etc.
	 * 
	 * @return The encoding scheme.
	 */
	public String getEncodingScheme();

	/**
	 * The type of the EPC tag. e.g. sgtin, sscc, DoD, etc.
	 * 
	 * @return The tag type.
	 */
	public String getTagType();

	/**
	 * Get the bit length of the tag type. e.g. 64, 96, 198.
	 * 
	 * @return The bit length of the tag type.
	 */
	public int getTagBitLength();

	/**
	 * Additional info about this tag such as read time, readerID, temperature,
	 * etc.
	 * 
	 * @return A Map contains key-value pairs.
	 */
	public Map<String, String> getAdditionalData();

}
